// initial state
const state = () => ({
  collapse: false,
});

// getters
const getters = {
  getCollapse(state) {
    return state.collapse;
  },
};

// mutations
const mutations = {
  // 侧边栏折叠
  setCollapse(state, collapse) {
    state.collapse = collapse;
  },
};

// actions
const actions = {
  changeCollapse({ state, commit }) {
    commit("setCollapse", !state.collapse);
  },
};

export default {
  namespaced: true,
  state,
  getters,
  actions,
  mutations,
};
